<template>
	<view>
		<uni-drawer class="container" ref="showLeft" mode="left" :width="drawerWidth" @change="changeMenu">
			<view class="head">
				<view class="left">
					<view class="header-sculpture" @click="jump(17)">
						<view :class="[[0,1].includes(content.userIdentityStatus)||userToken=='' ?'img':'img2' ]  ">
							<image v-if="content.userIdentityStatus==0||(userToken=='')" class="frame" src="" mode=""
								src="https://images.linglinggong.net/static/icon3/1.png"></image>
							<image v-if="content.userIdentityStatus==1||content.approvalFlag==1" class="frame"
								src="https://images.linglinggong.net/static/icon3/2.png">
							</image>
							<image v-if="content.userIdentityStatus==2" class="frame"
								src="https://images.linglinggong.net/static/icon3/3.png">
							</image>
							<text class="undone" v-if="userToken==''">未登录</text>
							<!-- // 0默认头像 1审核未通过，更换头像 2已认证 3审核中 -->
							<image class="avatar" v-if="[0,1,3,'',null].includes(headStatus)"
								src="https://images.linglinggong.net/static/logo.png" mode="">
							</image>
							<image v-if='headStatus==2' class="avatar" :src="pic+'?imageView2/1/w/80/h/80'">
							</image>
						</view>
					</view>
					<view class="name" @click="jump(3)">
						<text v-if="userInfo.realName">{{ userInfo.realName}}</text>
						<text v-else style="color: #FE4538;font-size: 28rpx;">未实名，立即前往</text>
						<image src="https://images.linglinggong.net/static/newMy/staff-my4.png" mode=""></image>
					</view>
				</view>
				<view class="header-box-gen" @click="gomessage">
					<image src="https://images.linglinggong.net/static/homechange/news.png" mode=""></image>
					<view class="red-dot" v-if="redDot">
					</view>
				</view>
			</view>
			<scroll-view scroll-y="true" :style="{height: `${drawerScrollHeight}rpx`}">
				<newStaffMyCard @click="jump(1)" :content='content' :dataTime='dataTime'
					:bannerList='(curryIndex==0&&list)||(curryIndex==1&&list2)||((curryIndex==2&&userIdentity!=3)&&list3)||(userIdentity == 3 && list4)'>
				</newStaffMyCard>
				<view class="content">
					<view class="module1">
						<view @click="jump(4)">
							<view class=""> {{score}} </view>
							<view class="">
								<text>评分</text>
								<image src="https://images.linglinggong.net/static/newMy/staff-my9.png" mode=""></image>
							</view>
						</view>
						<view class="line">
						</view>
						<view @click="jump(5)">
							<view class=""> {{nowDayIncome}} </view>
							<view class="">
								<text>今日收入</text>
								<image src="https://images.linglinggong.net/static/newMy/staff-my9.png" mode=""></image>
							</view>
						</view>
					</view>
					<view class="module2">
						<view class="title">
							<view class="">
								<text style="margin-left: 10rpx;
color: #262626;">综合评分</text>
								<view class="tip">
									<image @click="isShowTipTab=!isShowTipTab"
										src="https://images.linglinggong.net/static/newMy/staff-my8.png" mode="">
									</image>
								</view>
								<view class="tipTab" v-if="isShowTipTab" @click="isShowTipTab=false">
									<view class="text">
										<text>以下内容，将会在您接单时，向雇主展示。</text><br>
										<text @click.stop="goRule()">请务必遵守平台规则</text>
									</view>
								</view>
							</view>
							<view v-if="height==0" @click="height=220">
								<image style="margin-top: 6rpx;"
									src="https://images.linglinggong.net/static/newMy/staff-my28.png" mode=""></image>
							</view>
							<view v-else @click="height=0">
								<image src="https://images.linglinggong.net/static/newMy/staff-my17.png" mode="">
								</image>
							</view>
						</view>
						<view class="my-info-center" :style="{'height':`${height}rpx`}">
							<view class="my-info-center-item">
								<view class="my-info-center-item-left">
									<text>好评率</text>
								</view>
								<view class="my-info-center-item-mid">
									<u-line-progress :height="8" :showText="false" activeColor="#FCC928"
										:percentage="pingjia.positiveReviewRate*100"></u-line-progress>
								</view>
								<view class="my-info-center-item-right">
									<text
										v-if="pingjia.positiveReviewRate">{{(pingjia.positiveReviewRate*100).toFixed(0)}}%</text>
									<text v-else>0%</text>
								</view>
							</view>
							<view class="my-info-center-item">
								<view class="my-info-center-item-left">
									<text>完单率</text>
									<view class="tip">
										<uni-tooltip :styleType="1" :styleType2="1" :styleType3="1"
											content="雇主发布时长和雇员实际工作时长的比例">
											<image src="https://images.linglinggong.net/static/newMy/staff-my8.png"
												mode=""></image>
										</uni-tooltip>
									</view>
								</view>
								<view class="my-info-center-item-mid">
									<u-line-progress :height="8" :showText="false" activeColor="#FCC928"
										:percentage="pingjia.taskCompletionRate*100"></u-line-progress>
								</view>
								<view class="my-info-center-item-right">
									<text
										v-if="pingjia.taskCompletionRate">{{(pingjia.taskCompletionRate*100).toFixed(0)}}%</text>
									<text v-else>0%</text>
								</view>
							</view>
							<view class="my-info-center-item">
								<view class="my-info-center-item-left">
									<text>试工率</text>
									<view class="tip">
										<uni-tooltip :styleType="1" :styleType2="1" :styleType3="1"
											content="雇员到达现场试工后通过次数的比例">
											<image src="https://images.linglinggong.net/static/newMy/staff-my8.png"
												mode=""></image>
										</uni-tooltip>
									</view>
								</view>
								<view class="my-info-center-item-mid">
									<u-line-progress :height="8" :showText="false" activeColor="#FCC928"
										:percentage="pingjia.trialSuccessRate*100"></u-line-progress>
								</view>
								<view class="my-info-center-item-right">
									<text
										v-if="pingjia.trialSuccessRate">{{(pingjia.trialSuccessRate*100).toFixed(0)}}%</text>
									<text v-else>0%</text>
								</view>
							</view>
							<view class="my-info-center-item">
								<view class="my-info-center-item-left">
									<text>准确率</text>
									<view class="tip">
										<uni-tooltip :styleType="1" :styleType2="1" :styleType3="1"
											content="雇员收工后，雇主在当日24点之前结算次数">
											<image src="https://images.linglinggong.net/static/newMy/staff-my8.png"
												mode=""></image>
										</uni-tooltip>
									</view>
								</view>
								<view class="my-info-center-item-mid">
									<u-line-progress :height="8" :showText="false" activeColor="#FCC928"
										:percentage="pingjia.timeArrivalRate*100"></u-line-progress>
								</view>
								<view class="my-info-center-item-right">
									<text
										v-if="pingjia.timeArrivalRate">{{(pingjia.timeArrivalRate*100).toFixed(0)}}%</text>
									<text v-else>0%</text>
								</view>
							</view>
						</view>
					</view>
					<view class="module3">
						<view class="title">
							<view class="line">
							</view>
							<text style="font-weight: bold;color: #262626;">活动中心</text>
						</view>
						<view class="center">
							<view class="item" @click="jump(6)">
								<view class="">
									<text>邀请有礼</text>
									<text>邀请好友有礼</text>
								</view>
								<image src="https://images.linglinggong.net/static/newMy/staff-my30.png" mode="">
								</image>
							</view>
							<view v-if="goldStarCityConfiguration" class="item" @click="jump(7)">
								<view class="">
									<text>金牌之星</text>
									<text>金牌奖励 300元</text>
								</view>
								<image src="https://images.linglinggong.net/static/newMy/staff-my29.png" mode="">
								</image>
							</view>
							<view class="item" @click="jump(77)">
								<view class="">
									<text>奖励中心</text>
									<text>领取达标奖励</text>
								</view>
								<image src="https://images.linglinggong.net/static/newMy/3.png" mode=""></image>
							</view>
						</view>
					</view>
					<view class="module4">
						<view class="title">
							<view class="line">
							</view>
							<text style="color: #262626;font-weight: bold;">工作必备</text>
						</view>
						<view class="center">
							<view class="item" @click="jump(8)">
								<view class="newTab"> 新 </view>
								<image src="https://images.linglinggong.net/static/newMy/staff-my11.png" mode="">
								</image>
								<text>零工培训</text>
							</view>
							<view class="item" @click="jump(9)">
								<view class="newTab"> 新 </view>
								<image src="https://images.linglinggong.net/static/newMy/staff-my12.png" mode="">
								</image>
								<text>工作装备</text>
							</view>
							<view class="item" @click="jump(10)">
								<view class="newTab newTab3"> 可申诉 </view>
								<image src="https://images.linglinggong.net/static/newMy/staff-my13.png" mode="">
								</image>
								<text>订单申诉</text>
							</view>
							<view class="item">
							</view>
						</view>
					</view>
					<view class="module5">
						<view class="title">
							<view class="line">
							</view>
							<text style="color: #262626;font-weight: bold;">常用功能</text>
						</view>
						<view class="center">
							<view class="item" @click="jump(11)">
								<image src="https://images.linglinggong.net/static/newMy/staff-my16.png" mode="">
								</image>
								<text>我的收藏</text>
							</view>
							<view class="item" @click="jump(13)">
								<image src="https://images.linglinggong.net/static/newMy/staff-my14.png" mode="">
								</image>
								<text>意见反馈</text>
							</view>
							<view class="item" @click="jump(16)">
								<image src="https://images.linglinggong.net/static/newMy/staff-my24.png" mode="">
								</image>
								<text>黑名单</text>
							</view>
							<view class="item" @click="jump(2)">
								<image src="https://images.linglinggong.net/static/newMy/staff-my3.png" mode=""
									class="setImg"></image>
								<text>系统设置</text>
							</view>
						</view>
					</view>
				</view>
			</scroll-view>
			<view class="module6">
				<text style="font-weight: bold;color: #262626;">语音播报</text>
				<switch :checked="checked1" class="switch" @change="handleChange" color="#FCC928" />
			</view>
			<view class="module7" @click="openPopup()">
				<image src="https://images.linglinggong.net/static/newMy/staff-my1.png" mode=""></image>
				<text style="font-weight: bold;
                color: #333333;">客服中心</text>
			</view>
			<uni-popup ref="popup" type="bottom" :safe-area="false">
				<view class="inner">
					<view class="callCenter">
						<view class="customer">
							<text>客服中心</text>
							<image @click="closePopup()"
								src="https://images.linglinggong.net/static/newMy/staff-my18.png" mode=""></image>
						</view>
					</view>
					<view class="jobTime">工作时间 {{ businessHours }}</view>
					<view class="" @click="jump(14)">
						<image src="https://images.linglinggong.net/static/newMy/staff-my20.png" mode=""></image>
						<text>在线客服</text>
					</view>
					<view class="" @click="jump(15)">
						<image src="https://images.linglinggong.net/static/newMy/staff-my19.png" mode=""></image>
						<text>电话客服</text>
					</view>
				</view>
			</uni-popup>
		</uni-drawer>
		<!-- 去学习 -->
		<studyVideo v-if='showGrow' @toClose='toClose' :isStydu='content.studyFlag' :video='video' :typeVide='typeVide'>
		</studyVideo>
	</view>
</template>
<script>
	import studyVideo from '../helpMosk/mosk.vue'
	import newStaffMyCard from '@/components/newStaffMyCard/newStaffMyCard.vue'
	import {
		get_property_list_by_type,
	} from '@/libs/unit.js'
	import {
		he_evaluate_lv,
	} from '@/libs/unit.js'
	export default {
		name: "newStaffMy",
		data() {
			return {
				typeVide: 4,
				showGrow: false,
				video: 'https://images.linglinggong.net/%E6%AD%A3%E5%BC%8F%E6%A8%A1%E6%8B%9F%E6%95%99%E5%AD%A6%E8%A7%86%E9%A2%91_1.mp4',
				userToken: uni.getStorageSync('token'),
				isShowPop: false,
				vipJinPai: 'https://images.linglinggong.net/static/icon3/adasdasd.png',
				vipZuanSi: "https://images.linglinggong.net/static/icon3/ZuanSiadasdasd (2).png",
				MoRen: 'https://images.linglinggong.net/static/logo.png',
				pic: '', //新增修改
				vipFlag: 0, //0不是vip雇员，1vip雇员 2 钻石
				real_auth_integrity: '', //实名认证诚信值奖励
				isPageShow: false, //是否显示页面
				serviceTelephone: '400-98393', //客服电话
				isShowheadImage: false,
				isShowHaoPingInfo: false,
				expirationTime: '',
				vipTime: '',
				isShowKefu: false,
				screenWidth: '',
				screenHeight: '',
				headTesx: "",
				content: {},
				ishasMonery: false,
				userInfo: uni.getStorageSync('userInfo'),
				userDetail: {},
				height: 0,
				checked1: uni.getStorageSync('checked1'), //开关是否开着
				pic: '',
				flowObj: { //(type 0 资金 50 诚信值)
					type: 0,
					findDate: '',
					pageNum: 0,
					pageSize: 10,
				},
				nowDayIncome: 0,
				//身份晋升
				dataTime: 0,
				resData: {},
				userIdentity: 0,
				type: 1,
				curryIndex: 0,
				isShowTipTab: false,
				telephone: '',
				list: [{
					name: '试用任务1',
					img: 'https://images.linglinggong.net/static/icon3/grow/deful.png',
					title: '认证信息',
					title2: '',
					isOk: false
				}, {
					name: '试用任务2',
					img: 'https://images.linglinggong.net/static/icon3/grow/study11.png',
					title: '学习接单',
					title2: '',
					isOk: false
				}, {
					name: '试用任务3',
					img: 'https://images.linglinggong.net/static/icon3/grow/deful2.png',
					title: '完成2单',
					title2: '(无差评订单)',
					isOk: false
				}, ],
				list2: [{
					name: '正式任务1',
					img: 'https://images.linglinggong.net/static/icon3/grow/study33.png',
					title: '学习培训',
					title2: '',
					isOk: false
				}, {
					name: '正式任务2',
					img: 'https://images.linglinggong.net/static/icon3/grow/formal.png',
					title: '购买工装',
					title2: '(工装必备着装)',
					isOk: false
				}, {
					name: '正式任务3',
					img: 'https://images.linglinggong.net/static/icon3/grow/formal1.png',
					title: '完成3单',
					title2: '(无差评订单)',
					isOk: false
				}, ],
				list3: [{
					name: '晋升任务1',
					img: 'https://images.linglinggong.net/static/icon3/grow/gl1.png',
					title: '保证金',
					title2: '(晋升失败退回)',
					isOk: false
				}, {
					name: '晋升任务2',
					img: 'https://images.linglinggong.net/static/icon3/grow/study44.png',
					title: '专属培训',
					title2: '',
					isOk: false
				}, {
					name: '晋升任务3',
					img: '',
					title: '',
					title2: '',
					stu1: '',
					stu2: '',
					stu3: '',
					stu4: '',
					isOk: false
				}, {
					name: '晋升任务4',
					img: 'https://images.linglinggong.net/static/icon3/grow/tiemr.png',
					title: '',
					title2: '',
					isOk: false
				}, ],
				list4: [{
					name: '保留周期1',
					img: '',
					title: '',
					title2: '',
					stu1: '',
					stu2: '',
					stu3: '',
					stu4: '',
					isOk: false
				}, {
					name: '保留周期2',
					img: 'https://images.linglinggong.net/static/icon3/grow/formal1.png',
					title: '',
					title2: '',
					isOk: false
				}],
				//身份晋升
				drawerWidth: 620,
				headStatus: '',
				pingjia: {},
				contentHeight: '',
				drawerScrollHeight: '',
				// 客服营业时间
				businessHours: null,
				redDot: false,
				score: '', //评分
				goldStarCityConfiguration: false, //地区是否开启金牌活动 
			};
		},
		components: {
			newStaffMyCard,
			studyVideo
		},
		methods: {
			gomessage() {
				uni.navigateTo({
					url: '/pages/message/message-new'
				})
			},
			toClose() {
				this.getUserToken()
				this.showGrow = false
			},
			goRule() {
				uni.navigateTo({
					url: '/pages/syncAppNewPage/score/score-rule'
				})
			},
			changeMenu(e) {
				this.$emit('isShowMenu', e)
			},
			scroll(e) {
				console.log(e.detail)
			},
			closePopup() {
				this.$refs.popup.close('bottom')
			},
			openPopup() {
				this.$refs.popup.open('bottom')
			},
			// 获取资金流水
			async getMyflow() {
				this.nowDayIncome = 0
				let timer = new Date()
				this.flowObj.findDate = timer.getFullYear() + '-' + (timer.getMonth() + 1 < 10 ? '0' + (timer
				.getMonth() + 1) : timer.getMonth() + 1)
				let nowDay = timer.getFullYear() + '-' + (timer.getMonth() + 1 < 10 ? '0' + (timer.getMonth() + 1) :
					timer.getMonth() + 1) + '-' + (timer.getDate() < 10 ? '0' + timer.getDate() : timer.getDate())
				let res = await this.$fetch(this.$api.my_flow, this.flowObj, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				let newArr = res.rows.filter((item) => {
					return item.createTime.slice(0, 10) == nowDay
				})
				newArr.forEach((ele) => {
					if (ele.amount > 0) {
						this.nowDayIncome += ele.amount
					}
				})
				this.nowDayIncome = (this.nowDayIncome / 100).toFixed(2)
			},
			async getScore() {
				let res = await this.$fetch(this.$api.get_ratings, {}, 'GET')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.score = res.data.score
			},
			jump(val) {
				if (val == 1) {
					uni.navigateTo({
						url: '/pages/grow/grow'
					})
				} else if (val == 2) {
					uni.navigateTo({
						url: '/pages/syncAppNewPage/employee-set'
					})
				} else if (val == 3) {
					if (this.userInfo.realName) {
						uni.navigateTo({
							url: '/pages/syncAppNewPage/staff-userinfo/staff-userinfo'
						})
					} else {
						uni.navigateTo({
							url: '/pages/real-name/real-name'
						})
					}
				} else if (val == 4) {
					uni.navigateTo({
						url: '/pages/syncAppNewPage/score/score'
					})
				} else if (val == 5) {
					uni.navigateTo({
						url: '/pages/my-wallet/my-wallet'
					})
				} else if (val == 6) {
					uni.navigateTo({
						url: '/pages/invite-friend/invite-friend'
					})
				} else if (val == 7) {
					console.log('val==7', uni.getStorageSync('token'), uni.getStorageSync('region').slice(0, 6));
					uni.navigateTo({
						url: `/pages/orders/orders?token=${uni.getStorageSync('token')}&region=${uni.getStorageSync('region').slice(0,6)}`
					})
				} else if (val == 8) {
					uni.navigateTo({
						url: '/pages/help/help'
					})
				} else if (val == 9) {
					if (this.content.userIdentity == 0) {
						uni.showToast({
							title: '请先完成试用零工任务',
							icon: 'none'
						})
					} else if ((!this.content.studyFlag) && (this.content.userIdentity == 1 || this.content.userIdentity ==
							4)) {
						let that = this
						uni.showModal({
							title: '温馨提示',
							content: '请先完成正式零工培训',
							confirmText: '取消',
							cancelText: '去培训',
							success: function(res) {
								if (res.confirm) {
									console.log('用户点击取消')
								} else if (res.cancel) {
									that.showGrow = true
								}
							}
						});
					} else {
						uni.navigateTo({
							url: '/pages/syncAppNewPage/buy-clothing/buy-clothing'
						})
					}
				} else if (val == 10) {
					uni.navigateTo({
						url: '/pages/tousu/employee/index'
					})
				} else if (val == 11) {
					uni.navigateTo({
						url: '/pages/my-collect/my-collect'
					})
				} else if (val == 13) {
					uni.navigateTo({
						url: '/pages/tousu/boss/recommendation'
					})
				} else if (val == 14) {
					this.$refs.popup.close('bottom')
					uni.navigateTo({
						url: '/pages/onLinePage/kefu?userId=' + this.userInfo.userId
					})
				} else if (val == 15) {
					this.$refs.popup.close('bottom')
					uni.makePhoneCall({
						phoneNumber: this.telephone
					})
				} else if (val == 16) {
					uni.navigateTo({
						url: '/pages/app-employer/my-employee/my-blackList'
					})
				} else if (val == 77) {
					uni.navigateTo({
						url: '/pages/sendCode/list'
					})
				} else if (val == 17) {
					if (this.userInfo.realName) {
						uni.navigateTo({
							url: '/pages/syncAppNewPage/staff-userinfo/staff-userinfo'
						})
					}
				}
			},
			handleChange(e) {
				this.checked1 = e.detail.value
				uni.setStorageSync('checked1', e.detail.value)
			},
			async getUser(userId) {
				let res = await this.$fetch(this.$api.get_user_by_id, {
					userId: userId
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				he_evaluate_lv(res.data.userId).then((v) => {
					res.data.haoping = v
				})
				this.userDetail = res.data
				this.pic = uni.getStorageSync('imgPath') + (uni.getStorageSync('userInfo').user.avatarto || uni
					.getStorageSync('userInfo').user.avatar)
			},
			showDrawer() {
				this.$refs.showLeft.open()
			},
			hiddenDrawer() {
				this.$refs.showLeft.close()
			},
			// 关闭
			popClose() {
				this.isShowPop = false
				this.ishasMonery = false
			},
			//0默认头像 1审核未通过，更换头像 2已认证 3审核中
			isDefultHead() {
				let avatarto = (this.userInfo.user.avatarto == null || this.userInfo.user.avatar == this.userInfo.user
					.avatarto) ? this.userInfo.user.avatar : this.userInfo.user.avatarto
				let idavaterStatus = this.userInfo.user.idavaterStatus
				this.pic = avatarto ? uni.getStorageSync('imgPath') + avatarto :
					'https://images.linglinggong.net/FqbM4OLbmiUwDDB984eZl5lJudxS'
				// console.log('头像',this.pic)
				// console.log(this.pic,uni.getStorageSync("pics"),uni.getStorageSync('imgPath')); 
				if (uni.getStorageSync("pics") == '' || uni.getStorageSync("pics") == null) {
					uni.setStorageSync("pics", uni.getStorageSync('imgPath') + avatarto)
				}
				this.headStatus = idavaterStatus
				// !avatarto && idavaterStatus == 0 ? 0 : avatarto && idavaterStatus == 0 ? 1 : avatarto &&
				// 	idavaterStatus == 1 ? 2 : avatarto && idavaterStatus == 2 ? 3 : 0
				// console.log(this.headStatus ,"默认头像");
				if (this.headStatus == 0) {
					this.headTesx = "更换头像"
				} else if (this.headStatus == 1) {
					this.headTesx = "审核失败"
				} else if (this.headStatus == 2) {
					this.headTesx = "已认证"
				} else if (this.headStatus == 3) {
					this.headTesx = "审核中"
				}
			},
			getJinpaiInfo() {
				uni.navigateTo({
					url: '/pages/grow/grow'
				})
			},
			computationTime() {
				let d = new Date(),
					y = d.getFullYear(),
					m = d.getMonth() + 1
				let toDay = d.getDate()
				let lastDay = new Date(y, m, 0).getDate()
				// this.vipTime = y + '.' + m + '.' + lastDay
				// this.expirationTime = lastDay - toDay
				this.vipTime = this.userInfo.vipEndDate;
				this.expirationTime = this.userInfo.vipRemainingTime;
			},
			//获取用户信息
			async getUserToken() {
				let res = await this.$fetch(this.$api.get_user_by_token, {}, 'POST')
				if ([2, 3].includes(this.content.userIdentity)) {
					let data = new Date().getTime()
					let c = new Date(this.content.goldMedalEndTime.replaceAll('-', '/')).getTime()
					let d = ((c - data) / (1000 * 3600 * 24))
					this.dataTime = parseInt(d)
				}
				let {
					idCardStatus, //实名认证
					stopCompleteCount, //已完成单数
					needCompleteCount,
					userIdentity, //0 试用零工 1 正式零工 2 金牌晋升期 3 金牌保留期 4 待激活正式零工 5 待激活金牌晋升期
					ensureAccount, //保证金
					studyFlag, // 是否学习
					userPromotionFlag, //保留金牌 1保留失败  0成功 
					noviceguide, // 新人学习
					goldMedalEndTime, //vip到期时间
					frockFlag, //是否购买工装  0 否  1 是
					userIdentityStatus
				} = res.data
				this.resData = res.data
				this.userIdentity = userIdentity //：0 试用零工 1 正式零工 2 金牌晋升期 3 金牌保留期 4 待激活正式零工 5 待激活金牌晋升期
				this.content = res.data
				this.type = userIdentityStatus
				this.curryIndex = userIdentityStatus
				// 渲染列表  实名+完成3单 
				if (idCardStatus == 2) {
					this.list[0].isOk = true
				} else {
					this.list[0].isOk = false
				}
				// 是否学习新人教学
				if (noviceguide) {
					this.list[1].isOk = true
				} else {
					this.list[1].isOk = false
				}
				if (userIdentity !== 0 || (userIdentity == 0 && stopCompleteCount >= needCompleteCount)) {
					this.list[2].isOk = true
				} else {
					this.list[2].isOk = false
				}
				// z正式零工 购买工装 完成5单  学习培训
				if (userIdentityStatus == 2 || (studyFlag)) {
					this.$set(this.list2[0], 'isOk', true)
				} else {
					this.$set(this.list2[0], 'isOk', false)
				}
				if (this.content.frockFlag == 1) {
					this.$set(this.list2[1], 'isOk', true)
				} else {
					this.$set(this.list2[1], 'isOk', false)
				}
				if (([1, 2].includes(userIdentityStatus) && stopCompleteCount >= needCompleteCount)) {
					this.$set(this.list2[2], 'isOk', true)
				} else {
					this.$set(this.list2[2], 'isOk', false)
				}
				// 金牌
				if (ensureAccount !== null && ensureAccount > 0) {
					this.$set(this.list3[0], 'isOk', true)
				} else {
					this.$set(this.list3[0], 'isOk', false)
				}
				// 是否学习
				if (userIdentityStatus == 2 || (userIdentity == 5 && studyFlag == 3)) {
					this.$set(this.list3[1], 'isOk', true)
				} else {
					this.$set(this.list3[1], 'isOk', false)
				}
				// 保证金  订单 stopCompleteCount  needCompleteCount   工时 stopUserOrderCount   needUserOrderCount 雇主数 stopTaskUserId  needTaskUserId   评分 stopUserScore needUserScore
				if (userIdentity == 2 && (this.content.stopCompleteCount >= this.content.needCompleteCount && this
						.content.stopUserOrderCount >= this.content.needUserOrderCount && this.content
						.stopTaskUserId >= this.content.needTaskUserId && this.content.stopUserScore >= this.content
						.needUserScore)) {
					this.$set(this.list3[2], 'isOk', true)
				} else {
					this.$set(this.list3[2], 'isOk', false)
				}
				//  晋升时间获取vip时间
				if ([2, 3].includes(userIdentity)) {
					let data = new Date().getTime()
					let c = new Date(goldMedalEndTime.replaceAll('-', '/')).getTime()
					let d = ((c - data) / (1000 * 3600 * 24))
					this.dataTime = parseInt(d)
					if (this.dataTime == 0) {
						this.$set(this.list3[3], 'isOk', true)
					} else {
						this.$set(this.list3[3], 'isOk', false)
					}
				}
				// 保留 list4
				if (userIdentity == 3 && (this.content.stopCompleteCount >= this.content.needCompleteCount && this
						.content.stopUserOrderCount >= this.content.needUserOrderCount && this.content
						.stopTaskUserId >= this.content.needTaskUserId && this.content.stopUserScore >= this.content
						.needUserScore)) {
					this.$set(this.list4[0], 'isOk', true)
				} else {
					this.$set(this.list4[0], 'isOk', false)
				}
				//  保留时间 list4
				if (goldMedalEndTime) {
					let data = new Date().getTime()
					let c = new Date(goldMedalEndTime.replaceAll('-', '/')).getTime()
					let d = ((c - data) / (1000 * 3600 * 24))
					this.dataTime = parseInt(d)
					if (this.dataTime == 0) {
						this.$set(this.list4[1], 'isOk', true)
					} else {
						this.$set(this.list4[1], 'isOk', false)
					}
				}
				uni.setStorage({
					key: "Mosktime",
					data: false,
				});
				// userIdentity == 4 && this.curryIndex == 0
				if (userIdentity == 4 && this.curryIndex == 0) {
					this.moskShow = true //没有弹框
					this.title = '正式零工' //提升弹框标题
					this.title2 = '激活后，身份变动为正式零工'
				} else if (userIdentity == 1 && this.curryIndex == 1) {
					this.moskShow2 = true //带有icon的弹框
					this.imgNmuber = 5 //带有icon 地址
					this.iconTitle = '正式零工'
					this.iconTitle2 = '您已享受正式零工权益'
				} else if (userIdentity == 5 && this.curryIndex == 1) {
					this.moskShow = true //没有弹框
					this.title = '金牌零工' //提升弹框标题
					this.title2 = '激活后，可直接享受金牌权益'
				} else if (userIdentity == 3 && this.curryIndex == 2) {
					this.moskShow2 = true //带有icon的弹框
					this.imgNmuber = 1
					this.iconTitle = '金牌零工'
					this.iconTitle2 = '请在下一个保留期内继续努力!'
				} else if (userIdentity == 2 & userPromotionFlag == 1) { //晋升失败
					this.moskShow2 = true //带有icon的弹框
					this.imgNmuber = 4
					this.iconTitle = '正式零工'
					this.iconTitle2 = '保证金已退回至您的余额,请前往钱包查看!'
				} else if (userIdentity == 3 && userPromotionFlag == 0 && this.curryIndex == 2) {
					this.moskShow2 = true //带有icon的弹框
					this.imgNmuber = 2
					this.iconTitle = '金牌零工'
					this.iconTitle2 = '将开启 30天 的金牌保留期'
				} else if (userIdentity == 3 & userPromotionFlag == 1) { //保留失败
					this.moskShow2 = true //带有icon的弹框
					this.imgNmuber = 3
					this.iconTitle = '正式零工'
					this.iconTitle2 = '保证金已退回至您的余额,请前往钱包查看!'
				}
				this.getUser(res.data.userId)
			},
			async employee_evaluation() {
				let res = await this.$fetch(this.$api.employee_evaluation, {
					userId: uni.getStorageSync('userInfo').userId
				}, 'POST')
				if (res.code) uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.pingjia = res.data
			},
			// 客服营业时间
			async businessHoursFun() {
				let res = await get_property_list_by_type()
				this.businessHours = res.customer_service_date;
			},
			async get_push_message_records_red_dot() {
				let res = await this.$fetch(this.$api.get_push_message_records_red_dot, {}, 'GET')
				if (res.code) uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.redDot = res.data
			}
		},
		mounted() {
			this.goldStarCityConfiguration = uni.getStorageSync('property_list_by_type').goldStarCityConfiguration
			// 未登录的用户，跳转到登录页面
			if (!uni.getStorageSync('token')) {
				uni.redirectTo({
					url: '/pages/login/login'
				})
			} else {
				this.isPageShow = true
				this.getUserToken()
				this.getMyflow()
				this.getScore()
				this.get_push_message_records_red_dot()
				this.telephone = uni.getStorageSync('property_list_by_type').telephone
				this.employee_evaluation()
			}
			this.real_auth_integrity = uni.getStorageSync('real_auth_integrity')
			// 进入后判断是否和请求的数据和本地的一致就代表后端没有更新新的时间节点
			// let newTime = uni.getStorageSync('businessHours') ? uni.getStorageSync('businessHours') : this
			this.businessHoursFun();
			// this.businessHours = newTime;
			// if (uni.getStorageSync('businessHours')) {
			// 	this.businessHours = uni.getStorageSync('businessHours')
			// } else {
			// 	this.businessHoursFun();
			// }
		},
		created() {
			this.contentHeight = uni.getWindowInfo().screenHeight
			if (this.contentHeight > 700) {
				if (this.contentHeight > 750) {
					this.drawerScrollHeight = 1140
				} else {
					this.drawerScrollHeight = 900
				}
			} else {
				this.drawerScrollHeight = 850
			}
			console.log('contentHeight', this.contentHeight)
			this.isDefultHead()
		},
	}
</script>
<style lang="less" scoped>
	.uni-drawer {
		z-index: 999;
	}

	.container /deep/ .uni-drawer__mask {
		position: fixed !important;
		overflow: hidden;
	}

	.container /deep/ .uni-drawer--left {}

	.container {
		.head {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 30rpx 0 30rpx;
			box-sizing: border-box;
			padding-bottom: 28rpx;

			.left {
				display: flex;
				align-items: center;

				.img {
					position: relative;
					width: 64rpx;
					height: 64rpx;

					.frame {
						width: 64rpx;
						height: 64rpx;
					}

					.frame1 {
						width: 84rpx;
						height: 84rpx;
					}

					.avatar {
						border-radius: 50%;
						position: absolute;
						top: 50%;
						left: 50%;
						width: 56rpx;
						height: 56rpx;
						margin-left: -28rpx;
						margin-top: -28rpx;
						z-index: 5;
					}

					text {
						font-size: 20rpx;
						position: absolute;
						bottom: 13rpx;
						right: 16rpx;
					}

					.undone {
						font-size: 20rpx;
						position: absolute;
						bottom: 0rpx;
						right: -60rpx;
						z-index: 99;
					}
				}

				.img2 {
					position: relative;
					width: 89rpx;
					height: 95rpx;

					.frame {
						width: 89rpx;
						height: 95rpx;
					}

					.frame1 {
						width: 89rpx;
						height: 95rpx;
					}

					.avatar {
						border-radius: 50%;
						position: absolute;
						top: 53%;
						left: 50%;
						width: 62rpx;
						height: 62rpx;
						margin-left: -31rpx;
						margin-top: -27rpx;
						z-index: 5;
					}

					text {
						font-size: 20rpx;
						position: absolute;
						bottom: 13rpx;
						right: 16rpx;
					}

					.undone {
						font-size: 20rpx;
						position: absolute;
						bottom: 0rpx;
						right: -60rpx;
						z-index: 99;
					}
				}

				&>.name {
					display: flex;
					position: relative;
					align-items: center;
					margin-left: 20rpx;

					&>text {
						color: #000000;
						font-size: 36rpx;
						line-height: 64rpx;
						margin-right: 5rpx;
					}

					image {
						width: 36rpx;
						height: 36rpx;
					}
				}

				&>text {
					height: 34rpx;
					font-size: 12px;
					color: rgba(64, 33, 16, 0.70);
				}

				&>.category {
					margin-top: 48rpx;
					background-color: #FFFFFF;
					display: flex;
					width: 100%;

					&>view {
						position: relative;
						display: flex;
						flex-direction: column;
						align-items: center;
						justify-content: center;
						flex: 1;

						&>text {
							font-size: 22px;
							color: #F39B19;
							height: 60rpx;
						}

						&>view:not(.pingfen) {
							display: flex;
							align-items: center;

							text {
								font-size: 12px;
								color: rgba(64, 33, 16, 0.70);
								text-align: center;
								margin-right: 2rpx;
							}

							image {
								width: 14.2rpx;
								height: 14.2rpx;
							}
						}

						&::after {
							content: "";
							position: absolute;
							right: 0rpx;
							width: 2rpx;
							height: 50rpx;
							background: #F0F0EF;
							border-radius: 2.5px;
						}
					}
				}
			}

			.right {
				width: 48rpx;
				height: 48rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		.content {
			padding: 30rpx;
			background-color: #FFFFFF;
			box-shadow: 0 -6rpx 8rpx -2rpx rgba(109, 112, 130, 0.50);

			.module1 {
				width: 100%;
				height: 122rpx;
				border-radius: 16rpx;
				background-color: #F1F1F5;
				padding: 16rpx 50rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-around;
				align-items: center;

				.line {
					width: 2rpx;
					height: 80rpx;
					background-color: #E7E7EB;
				}

				&>view {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: space-between;

					view:nth-child(1) {
						font-size: 40rpx;
						color: #262626;
						font-weight: bold;
					}

					view {
						text {
							font-size: 24rpx;
							color: #515151;
						}

						image {
							width: 16rpx;
							height: 16rpx;
						}
					}
				}
			}

			.module2 {
				width: 100%;
				background-color: #F1F1F5;
				border-radius: 12rpx;
				padding: 10rpx 10rpx;
				box-sizing: border-box;
				margin-top: 20rpx;

				.title {
					display: flex;
					justify-content: space-between;
					align-items: center;

					&>view:nth-child(1) {
						display: flex;
						align-items: center;
						position: relative;

						.tip {
							image {
								width: 26rpx;
								height: 26rpx;
								margin-left: 16rpx;
							}
						}

						.tipTab {
							position: absolute;
							top: 20rpx;
							left: 94rpx;
							z-index: 99;
							width: 420rpx;
							height: 120rpx;
							background: url('https://images.linglinggong.net/static/newMy/tipbg.png')no-repeat;
							background-size: 100%;
							letter-spacing: -2rpx;
							color: #000000;
							font-size: 20rpx;
							line-height: 30rpx;

							.text {
								margin: 40rpx 20rpx auto 40rpx;

								&>text:last-child {
									color: #F85A41;
								}
							}
						}
					}

					view:nth-child(2) {
						image {
							width: 32rpx;
							height: 32rpx;
						}
					}
				}

				.my-info-center {
					// border: 1px solid;
					width: 100%;
					height: 100%;
					// background: red;
					display: flex;
					justify-content: center;
					align-items: center;
					flex-direction: column;
					padding: 0rpx 0 0 0;
					overflow: hidden;
					transition: height linear 0.3s 0.1s;

					.my-info-center-item {
						width: 100%;
						display: flex;
						justify-content: space-between;
						align-items: center;
						margin: 10rpx 0;

						.my-info-center-item-left {
							width: 120rpx;
							display: flex;
							align-items: center;

							// border: 1px solid;
							.tip {

								// border: 1px solid;
								// width: 50rpx;
								// border: 1px solid;
								image {
									width: 26rpx;
									height: 26rpx;
									margin-left: 16rpx;
								}
							}

							text {
								color: #000;
								font-size: 24rpx;
							}
						}

						.my-info-center-item-mid {
							flex: 1;
						}

						.my-info-center-item-right {
							margin-left: 20rpx;
							text-align: right;
							font-size: 26rpx;
							color: #000000;
						}
					}

					.my-info-center-item:first-child {
						padding-top: 10rpx;
					}
				}
			}

			.module3 {
				margin-top: 40rpx;

				.title {
					display: flex;
					align-items: center;
					margin-bottom: 30rpx;

					.line {
						width: 8rpx;
						height: 28rpx;
						background-color: #fcc92d;
						border-radius: 4rpx;
						margin-right: 12rpx;
					}
				}

				.center {
					display: flex;
					justify-content: space-between;
					flex-wrap: wrap;

					.item {
						width: 272rpx;
						height: 100rpx;
						display: flex;
						justify-content: space-between;
						align-items: center;
						background: rgba(236, 105, 105, 0.12);
						padding: 14rpx 10rpx 14rpx 20rpx;
						box-sizing: border-box;
						border-radius: 12rpx;

						view {
							text {
								display: block;
								color: #262626;
								font-size: 28rpx;
								font-weight: bold;
								line-height: 42rpx;
							}

							text:last-child {
								color: #515151;
								font-size: 20rpx;
								font-weight: normal;
							}
						}

						image {
							width: 72rpx;
							height: 72rpx;
						}
					}

					.item:nth-child(2) {
						background: rgba(242, 168, 255, 0.2);
					}

					.item:nth-child(3) {
						background: rgba(255, 0, 184, 0.1);
						margin-top: 30rpx;
					}
				}
			}

			.module4,
			.module5 {
				margin-top: 40rpx;

				.title {
					display: flex;
					align-items: center;
					margin-bottom: 30rpx;

					.line {
						width: 8rpx;
						height: 28rpx;
						background-color: #fcc92d;
						border-radius: 4rpx;
						margin-right: 12rpx;
					}
				}

				.center {
					display: flex;
					height: 120rpx;
					margin: 0 16rpx;
					justify-content: space-between;

					.item {
						width: 96rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						align-items: center;
						color: #000000;
						font-size: 24rpx;
						position: relative;

						.newTab {
							position: absolute;
							top: -16rpx;
							left: 50rpx;
							height: 28rpx;
							padding: 0 12rpx;
							color: #FFFFFF;
							font-size: 20rpx;
							line-height: 28rpx;
							z-index: 1;
							background-color: #F85A41;
							border-radius: 16rpx;
							box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(248, 90, 65, 0.50);
						}

						.newTab3 {
							position: absolute;
							top: -16rpx;
							left: 2rpx;
						}

						image {
							width: 76rpx;
							height: 76rpx;
						}

						.setImg {
							width: 50rpx !important;
							height: 50rpx !important;
							margin-top: 13rpx;
						}
					}
				}
			}
		}

		.module6 {
			margin: 0 30rpx;
			margin-top: 0rpx;
			height: 74rpx;
			background: #F1F1F5;
			border-radius: 12rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20rpx;
			box-sizing: border-box;

			.switch {
				transform: scale(0.6);
			}
		}

		.module7 {
			margin: 0 30rpx;
			margin-top: 30rpx;
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 12rpx;
			background-color: #FCC928;
			box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(252, 201, 40, 0.40);
			font-size: 36rpx;
			font-weight: bold;
			color: #333333;

			image {
				width: 40rpx;
				height: 40rpx;
				margin-right: 6rpx;
			}
		}

		.inner {
			width: 100vw;
			height: 390rpx;
			background-color: #FFFFFF;
			position: relative;
			border-radius: 24rpx 24rpx 0 0;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			&>view:nth-child(1) {
				// height: 156rpx;
				font-size: 40rpx;
				font-weight: bold;
				display: flex;
				align-items: center;
				justify-content: center;

				image {
					position: absolute;
					top: 22rpx;
					right: 20rpx;
					width: 72rpx;
					height: 72rpx;
				}
			}

			&>view:nth-child(3),
			&>view:nth-child(4) {
				height: 60rpx;
				font-size: 28rpx;
				font-weight: bold;
				color: #FF851D;
				display: flex;
				justify-content: center;
				align-items: center;
				margin-top: 40rpx;

				image {
					width: 40rpx;
					height: 40rpx;
					margin-right: 10rpx;
				}
			}

			.callCenter {
				display: flex;
				flex-direction: column;

				.customer {
					width: 100%;
					display: flex;
					justify-content: center;
					align-items: center;
					margin-bottom: 40rpx;
				}
			}
		}
	}

	.header-box-gen {
		width: 50rpx;
		height: 50rpx;
		position: relative;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.red-dot {
		position: absolute;
		right: 0rpx;
		top: 0rpx;
		width: 12rpx;
		height: 12rpx;
		border-radius: 50%;
		background-color: #F85A41;
		box-shadow: rgba(248, 90, 65, 0.50) 0 2rpx 6rpx 2rpx;
	}

	.jobTime {
		font-size: 30rpx;
		color: black;
		// position: absolute;
		// top: 134rpx;
	}
</style>